Application note: the Model Tree Editor
A model can be thought of as a tree, each branch of the tree being a part (a sub-assy), a set of parts or a sub-tree. Any branch at any level of the tree can be animated or can be subject to a condition. Let us take an example. I assume we want to build an assembly modelling a wing. This wing is made up of: This can be achieved through the following tree:

model tree sub-assy
inner wing
outer wing
INWING
OUTWING
animation aileron MYAILRN
aperture/closure well door MYDOOR
test gear is hidden when fully retracted
deployment/retraction gear strut MYSTRUT
damper animation gear damper
wheel shaft
MYDAMPR
MYSHAFT
wheel rotation wheel MYWHEEL

The INWING and OUTWING sub-assies are first level branches. The aileron animation is handled through an animated branch applying to the MYAILRN sub-assy. The well door animation is handled through an animated branch applying to the MYDOOR sub-assy. The gear (strut, damper, shaft and wheel) forms an animated sub-tree which is conditionnally displayed.

In the gear sub-tree, the MYSTRUT sub-assy is a first level branch. An animated branch performs the damping effect. This animated branch controls two basic sub-branches (MYDAMPR and MYSHAFT sub-assies) and an animated one which performs the wheel rotation (MYWHEEL sub-assy).

The Model Tree Editor allows to build and modify such a tree.


Model Tree Editor

The Model Tree Editor is launched by clicking on the button of the Graphic Editor tool bar. It is composed of four display sub-panels and a set of buttons.

The action of the different buttons is summarized in the following tables.

button action remark
add adds a new node to the selected one can't add a node to no-child node
can't add a third node to a test node
insert node insert a father node to the selected one can't add a node to the root node
delete deletes the selected node can't delete a child of a test node
can't delete the assy node
modify modifies the kind of a node opens a node selection window
or activates the properties button
properties defines the attribute of a node opens a dedicated input window
compile compiles the assembly unavailable in case of a master project
master project opens the master project model editor unavailable in case of a simple assembly
quit ends the model tree editor  

There are several kinds of node. They are listed in the following table.

node description node child attribute
assy root node yes assembly name
xno-op no operation no comment
ssub-assy sub-assy no sub-assy name
nnode grouping node yes node caption
mmoving simple animation based on a hinge yes animated part and hinge
rrolling simple animation of a wheel or of a prop yes wheel # or prop #, part position (vector)
aanim complex animation yes animated part and animation block
trtrans/rot translation/rotation yes hinge and angle
iftest test two condition
llight light cone or light spot no color, position and direction
wwire line no chain and color

The anim, moving, rolling and test nodes may be associated to different animation sequences. The light node may be associated to different kinds of light. The proposed options are given by the following table.

node attribute part animation
anim rotation block
translation block
(complex animation)
RIGHT GEAR
LEFT GEAR
CENTER GEAR
animate gear
RIGHT FLAP
LEFT FLAP
animate flap
RIGHT SPOILER
LEFT SPOILER
animate spoiler
RIGHT WING FOLD
LEFT WING FOLD
animate wing folding
RVRSR #1, RVRSR #2
RVRSR #3, RVRSR #4
animate thrust reverser
COWL #1, COWL #2
COWL #3, COWL #4
animate cowl flap
DOOR animate cargo door
HOOK animate tail hook
moving hinge
(simple animation)
RIGHT AILERON
LEFT AILERON
animate aileron
RUDDER animate rudder
STABILIZER animate stabilizer
RIGHT FLAP
LEFT FLAP
animate flap
RIGHT FLAPERON
LEFT FLAPERON
animate flaperon
RIGHT V TAIL FIN
LEFT V TAIL FIN
animate vertical tail fin
C STEER WHEEL steer center wheel
rolling vector
(position of the center
of rotation)
RIGHT WHEEL
LEFT WHEEL
CENTER WHEEL
rotate wheel
PROP #1, PROP #2
PROP #3, PROP #4
rotate propeller
test no attribute DOOR test door closure
RIGHT GEAR UP/DOWN
LEFT GEAR UP/DOWN
MID GEAR UP/DOWN
test gear position
RIGHT SPOILER DOWN
LEFT SPOILER DOWN
test spoiler position
RVRSR #1 CLOSED
RVRSR #2 CLOSED
RVRSR #3 CLOSED
RVRSR #4 CLOSED
test thrust reverser closure
LIGHT
LANDING LIGHT
test light status
STROBE ON test strobe status
test range PROP #1, PROP #2
PROP #3, PROP #4
test propeller speed
(% of max speed)
RIGHT FLAP
LEFT FLAP
test flap position (deg.)
light location NAV LIGHT
LOGO LIGHT
WING LIGHT
light spot
light location
direction
LANDING LIGHT
TAXI LIGHT
light spot


Attribute input windows

node selection window

The node selection window is launched when you click on the add button of the model tree editor. It allows you to select the kind of child node that you want to add to the selected node. It is also launched with a limited set of options when you click on the modify button while an anim, a moving or a rolling node is selected.

sub-assy selection window

The sub-assy selection window is launched when you click on the properties button of the model tree editor while a sub-assy node is selected. It allows you to select a sub-assy.

node caption input window

The node caption input window is launched when you click on the properties button of the model tree editor while a no-op node or a grouping node is selected. It allows you to enter a comment associated to the selected node.

anim attribute window (animation block editor panel)

The anim attribute window is launched when you click on the properties button of the model tree editor while an anim node is selected. It allows you to:

  • select the animate part,
  • define or modify the associated transformation block (rotation block or translation block),
  • define or edit a curve associated to the transformation block.

moving attribute window

The moving attribute window is launched when you click on the properties button of the model tree editor while a moving node is selected. It allows you to select:
  • the moving part,
  • the associated animation hinge.

rolling attribute window

The rolling attribute window is launched when you click on the properties button of the model tree editor while a rolling node is selected. It allows allows you to select:
  • the rolling part,
  • the vector which defines the position of the rolling axis.

test attribute window

The test attribute window is launched when you click on the properties button of the model tree editor while a test node is selected. It allows you to select:
  • the kind of test,
  • the test range if any.

light attribute window

The light attribute window is launched when you click on the properties button of the model tree editor while a light node is selected. It allows you to select:
  • the kind of light,
  • the 3 coordinates of the light position,
  • the 3 coordinates of a vector which defines the light direction if any.

wire attribute window

The wire attribute window is launched when you click on the properties button of the model tree editor while a wire node is selected. It allows for the selection of a chain belonging the Lines sub-assy associated to a color.


a very simple example
Let us take a very simple example. We want to model a retractable gear composed of a strut (MYSTRUT) and a rotating wheel (MYWHEEL).

model tree sub-assy
deployment/retraction right gear strut MYSTRUT
wheel rotation right wheel MYWHEEL

This model tree requires 3 different kinds of node (in addition to the assy root node):

  • two sub-assy nodes,
  • one anim node (gear retraction),
  • a rolling node (wheel rotation.

The rolling node is to be associated to a vector which defines the location of the wheel center of rotation.
The anim node is related to the right gear animation sequence. The motion achieved by this node is to be specified by an associated rotation block. Assuming that the MYSTRUT and MYWHEEL sub-assies represent the gear in the extended position, the rotation block (to be called RGEAR) can be defined by the following parameters:


key
  0 .. 100 100 .. 200
RGEAR   0 .. 90  90 .. 90

Therefore, the resulting tree is the following:

anim
kind: right gear
rotate block: RGEAR
sub-assy: MYSTRUT
rolling
kind: right wheel
vector : wheel position
sub-assy: MYWHEEL


the wing example
Let us go back to the wing example discussed at the beginning of this note.

model tree sub-assy
inner wing
outer wing
INWING
OUTWING
animation aileron MYAILRN
aperture/closure well door MYDOOR
test gear is hidden when fully retracted
deployment/retraction gear strut MYSTRUT
damper animation gear damper
wheel shaft
MYDAMPR
MYSHAFT
wheel rotation wheel MYWHEEL

This model tree requires 6 different kinds of node (in addition to the assy root node):

  • several sub-assy nodes,
  • three anim nodes (gear door closure/aperture, gear retraction, damper animation),
  • a moving node (aileron animation),
  • a rolling node (wheel rotation),
  • a test node (to hide the gear when fully retracted),
  • a no-op node (no operation when the gear is fully retracted).
The moving node is to be associated to a hinge which defines the aileron rotation axis.
The rolling node is to be associated to a vector which defines the location of the wheel center of rotation.
The three anim nodes are of the same kind since they are all related to the same animation sequence (right gear animation). The motion achieved by each node is specified by its associated rotation or transformation block.
Let us assume the following:
  • the MYDOOR sub-assy represents the door in the closed position,
  • the MYSTRUT, MYDAMPR, MYSHAFT and MYWHEEL sub-assies represent the gear in the extended position,
  • the door and the gear are moving in the same direction,
  • during the extension sequence, the door opens and then the gear is deployed,
  • during the retraction sequence, the gear is retracted and then the door is closed.
As it is mentioned in the related application note, any FS animation is described as a 200-step motion. In case of a gear animation, the 100 first steps are associated to the extension/retraction of the gear and the 100 to 200 steps are associated to the damping effect. To model the animation defined here above, we will create the following blocks:

key
  0 .. 50  50 .. 100 100 .. 200
RDOOR   0 .. 90  90 .. 90  90 .. 90
RGEAR -90 ..-90 -90 ..  0   0 ..  0
RDAMPR   0 ..  0
  0 ..  0
  0 ..  0
  0 ..  0
  0 ..  0
  0 ..  0
  0 ..  0
  0 ..  0
  0 .. 10

RDOOR rotation block
At the beginning of the deployment animation sequence, the door is closed:
  alpha =   0
  key   =   0
It opens during the first part of the sequence until it reaches its fully open position:
  alpha =  90
  key   =  50
Then it remains in the same position:
  alpha =  90
  key   = 100   up to   key   = 200

RGEAR rotation block
At the beginning of the deployment animation sequence, the gear is retracted:
  alpha = -90
  key   =   0
It does not move during the first part of the sequence:
  alpha = -90
  key   =  50
Then it deploys until it reaches its fully extended position:
  alpha =   0
  key   = 100
Then it remains in the same position:
  alpha =   0
  key   = 200

RDAMPR translation block
The damping effect only affects the z coordinate. At the beginning of the animation sequence, the damper is in its lowest position:
  z   =   0
  key =   0
It does not move during the deployment phase:
  z   =   0
  key = 100
Then it goes up until it reaches its highest position:
  z   =  10
  key = 200

The resulting tree is the following:

assy sub-assy: INWING
sub-assy: OUTWING
moving
kind: right aileron
hinge: aileron hinge
sub-assy: MYAILRN
anim
kind: right gear
rotate block: RDOOR
sub-assy: MYDOOR
test
kind: right gear up
comment: gear is hidden when fully retracted
anim
kind: right gear
rotate block: RGEAR
sub-assy: MYSTRUT
anim
kind: right gear
translate block: RDAMPR
sub-assy: MYDAMPR
sub-assy: MYSHAFT
rolling
kind: right wheel
vector : wheel position
sub-assy: MYWHEEL


copyright Hervé Devred 2003